home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: Linking libs with libs.
- Date: 20 Apr 1996 00:15:25 GMT
- Organization: OpenVision
- Message-ID: <4l9aat$2a0@spanky.pls.ov.com>
- References: <3177F0D7.7335@arcs.bcit.bc.ca>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article 7335@arcs.bcit.bc.ca, Travis Koch <travis@arcs.bcit.bc.ca> writes:
- >we have a problem..
- >developing a large project in Solaris 2.4, using
- >gcc 2.6.3 linking with f77 (don't ask).
- >
- >BTW f77 just calls Sun's ld, including some fortran
- >libs along the way.
- >
- >We have 2 static libraries which we need to keep
- >separate.
- >
- >I'm calling a function defined in libA.a from
- >libB.a. when compiling a small driver program, the
- >function is called only from the lib, and is
- >therefore not linked in.
- >
- >Question.
- >
- >does anyone know of a way to force linking of a
- >function from a static lib, even when its not
- >called?
- >
- >TIA
-
-
- Use ar to extract the object you want, then include the object in your
- list of .o files to be linked.
-
- Fletcher.Glenn@ov.com
-
-
-